#ifndef	ABSUI_CONNECTION_CONFIGURATION_WIDGET_HPP
#define ABSUI_CONNECTION_CONFIGURATION_WIDGET_HPP

#include "AbsUI/AbsUIConfig.hpp"
#include <cstddef>

namespace Storage { class ConnectionConfig; }

namespace AbsUI
{

/// @ingroup AbsUI
/// @brief It provides the interface to be implemented by all the connection configuration widgets.
class ABSUI_API ConnectionConfigurationWidget
{
public:
	/// @brief It initializes the connection configuration that should be edited.
	ConnectionConfigurationWidget( Storage::ConnectionConfig* pEditedConnConfig = NULL);

	/// @brief Dummy destructor
	virtual ~ConnectionConfigurationWidget();

	/// @brief It gets or sets the dirty flag.
	/// @{
	bool isDirty() const { return isDirty_; }
	void setDirty( bool newVal) { isDirty_ = newVal; }
	/// @}

	/// @brief It gets the edited connection configuration.
	/// @{
	const Storage::ConnectionConfig* editedConnCfg() const { return pEditedConnConfig_; }
	Storage::ConnectionConfig* editedConnCfg() { return pEditedConnConfig_; }
	/// @}

	/// @brief It should propagate the UI data to the edited connection configuration object.
	virtual void updateEditedConfig() = 0;

private:
	/// @brief The flag specifying whether the data inside the connection configuration was saved or not.
	bool isDirty_;

protected:
	/// @brief The connection configuration being edited.
	Storage::ConnectionConfig* pEditedConnConfig_;
};

} // namespace AbsUI

#endif // ABSUI_CONNECTION_CONFIGURATION_WIDGET_HPP
